/*
 * @Author: 胡俊/treence
 * @Date: 2022-05-27 15:47:23
 * @LastEditors: 徐伟杰
 * @LastEditTime: 2022-12-19 11:05:01
 * @Description: 
 * @Email: treence@gmail.com
 * @Company: 3xData
 * @youWant: add you want
 */
import globalPostRequest from '@/request/globalPostRequest.js'

// 单位列表查询
export function unitList (data, callback) {
    return globalPostRequest({
        url: '/taskInfo/getList',
        method: 'get',
        data,
        callback
    })
}
// 任务信息
export function unitForm (data, callback) {
    return globalPostRequest({
        url: '/taskInfo/byId/' + data,
        method: 'get',
        callback
    })
}
// 人脸比对
export function checkFace (data, callback) {
    return globalPostRequest({
        url: '/face/compareFace',
        method: 'post',
        data,
        callback
    })
}

// // 获取经纬度和项目负责人id
// export function getObtainLongitude (data, callback) {
//     return globalPostRequest({
//         url: '/project/partInfo',
//         method: 'post',
//         data,
//         callback,
//     })
// }

// 获取经纬度和项目负责人id
export function getObtainLongitude (data, callback) {
    return globalPostRequest({
        url: '/taskInfo/partInfo',
        method: 'post',
        data,
        callback,
    })
}


// 项目负责人确认任务时的接口
export function confirmTask (data, callback) {
    return globalPostRequest({
        url: '/taskInfo/confirm',
        method: 'post',
        data,
        callback,
    })
}

// 上传当前位置的经纬度，返回至为true或者fasle
export function uploadObtainLongitude (data, callback) {
    return globalPostRequest({
        url: '/project/distance',
        method: 'post',
        data,
        callback,
    })
}

// 获取当前账号的姓名及身份证信息
export function getUserInfo (data, callback) {
    return globalPostRequest({
        url: '/staff/byId/' + data.staffId,
        method: 'get',
        callback,
    })
}

// 执业表单修改
export function staffUpdate (data, callback) {
    return globalPostRequest({
        url: '/taskExecute',
        method: 'put',
        data,
        callback,
        header: {
            'content-type': 'application/json;charset=UTF-8'
        },
    })
}

// 执业表单查看
export function staffForm (data, callback) {
    return globalPostRequest({
        url: '/taskExecute/byId/' + data,
        method: 'get',
        callback,
    })
}

// 删除任务分发
export function delTask (taskId, callback) {
    return globalPostRequest({
        url: '/taskInfo/' + taskId,
        method: 'delete',
        callback
    })
}

// 新增任务分发
export function addTask (data, callback) {
    return globalPostRequest({
        url: '/taskInfo',
        method: 'post',
        data: data,
        callback,
        header: {
            'content-type': 'application/json;charset=UTF-8'
        },
    })
}

// 修改任务分发
export function updateTask (data, callback) {
    return globalPostRequest({
        url: '/taskInfo',
        method: 'put',
        data: data,
        callback,
        header: {
            'content-type': 'application/json;charset=UTF-8'
        },
    })
}

// 判断当前用户的级别是否为中级及中级以上
export function judgmentLevelList (data, callback) {
    return globalPostRequest({
        url: '/staff/byId/' + data,
        method: 'get',
        callback,
    })
}


// 当执业人员第一次执业时，没有执业地址时需将执业地址传给后端进行保存
export function taskExcuteRecord (data, callback) {
    return globalPostRequest({
        url: '/module/taskExcuteRecord',
        method: 'post',
        data: data,
        header: {
            'content-type': 'application/json;charset=UTF-8'
        },
        callback,
    })
}


// 添加人员时立即调用的人像采集对比
export function faceTest (data, callback) {
    return globalPostRequest({
        url: '/staff/faceTest',
        method: 'post',
        data: data,
        callback,
    })
}


// 现场待执业
export function getUnitListApi (data, callback) {
    return globalPostRequest({
        url: '/taskInfo/undoneTask',
        method: 'get',
        data,
        callback
    })
}


// 现场已执业
export function getDoneTaskApi (data, callback) {
    return globalPostRequest({
        url: '/taskInfo/doneTask',
        method: 'get',
        data,
        callback
    })
}

// 现场已过期
export function getExpireTaskApi (data, callback) {
    return globalPostRequest({
        url: '/taskInfo/expireTask',
        method: 'get',
        data,
        callback
    })
}

// 待确认任务
export function getUnConfirmApi (data, callback) {
    return globalPostRequest({
        url: '/taskInfo/unConfirm',
        method: 'get',
        data,
        callback
    })
}